package com.visceb.backstage.dao;
import com.visceb.backstage.entity.login;
import org.aspectj.weaver.Lint;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface loginRepository extends JpaRepository<login, Long>{

    login findFirstByUser(String user);
    List<login> findAllByUser(String user);
    List<login> findAllById(int id);
    List<login> findAllByStateAndDATA(String state, String Data);
//    @Query(value = "delete from login where id = ?1")
//    boolean deleteByUserId(int id);
    login findFirstById(int id);
    int deleteAllById(int id);
    int deleteAllByTime(String time);

//    @Modifying
//    @Query(value = "DELETE FROM login WHERE id = ?1", nativeQuery = true)
//    int deleteById(int id);
     int deleteById(int id);


}